<table class="form_table" cellpadding="0" cellspacing="0" style="border-top: 0px;">
  <caption style="border-bottom: 0px;">
    <%=t :plan_subjects%><br/>
    <%= @educational_plan.name%>
  </caption>
  <tr>
    <% for d in 1..@duration do %>
      <th><%= "#{@educational_plan.term.name} #{d}" %></th>
    <% end %>
  </tr>
  <% for i in 0...@row_count do %>
  <tr>
    <% for j in 0...@duration %>
      <% if @subject_list[j][i].nil? %>
        <td></td>
      <% else %>
        <td><%= render :partial => 'subject_in_plan', :locals => {:subject => @subject_list[j][i]} %></td>
      <% end %>
     <% end %>
  </tr>
  <% end %>
</table>

<div class="spacer"></div>

<table class="form_table" cellpadding="0" cellspacing="0" style="border-top: 0px;">
  <caption style="border-bottom: 0px;">
    <%= t(:optional_subjects) %>
  </caption>
  <tr>
    <% for k in 1..@duration do %>
      <%= "<th>#{@educational_plan.term.name} #{k}" unless @opt_subject_list[k-1][0].nil? %>
    <% end %>
  </tr>
  <% for m in 0...@opt_row_count do %>
  <tr>
    <% for n in 0...@duration %>
      <% unless @opt_subject_list[n][m].nil? %>
        <td><%= render :partial => 'opt_subject_in_plan', :locals => {:subject => @opt_subject_list[n][m]} %></td>
      <% end %>
     <% end %>
  </tr>
  <% end %>
</table>